package cn.bby.tools.actions.str.decode;

import cn.bby.tools.actions.str.BaseStringProcessAction;
import cn.hutool.core.util.HexUtil;
import com.intellij.openapi.actionSystem.AnActionEvent;

/**
 * Hex解码Action
 *
 * @author lingma
 * @since 2025/11/7
 */
public class DecodeHexAction extends BaseStringProcessAction {
    @Override
    public String process(AnActionEvent event, String selectedText) {
        try {
            return new String(HexUtil.decodeHex(selectedText));
        } catch (Exception e) {
            return selectedText;
        }
    }
}